package com.atguigu.tingshu.comment.api;

import com.atguigu.tingshu.comment.service.CommentService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Tag(name = "专辑评论管理")
@RestController
@RequestMapping("/api/comment")
@Slf4j
public class CommentApiController {

	@Autowired
	private CommentService commentService;

	public static void main(String[] args) {
		System.out.println(Runtime.getRuntime().availableProcessors());
		ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
				Runtime.getRuntime().availableProcessors(),
				Runtime.getRuntime().availableProcessors() * 2,
				60,
				TimeUnit.SECONDS,
				new ArrayBlockingQueue<>(1000),
				new ThreadPoolExecutor.AbortPolicy()
		);
		threadPoolExecutor.execute(() -> {
			System.out.println("hello");
		});

	}

}

